package com.myrslok.module;

import org.jetbrains.annotations.NotNull;

import java.io.File;
import java.util.HashSet;
import java.util.Set;

public class MyrslokModuleSettings extends BasicModuleSettings {

    /**
     * Creates an empty module with the name <code>module</code> under <code>module</code> dir.
     * @param module the name (and dir) of the module
     */
    public MyrslokModuleSettings(@NotNull final String module) {
        super(module);
        initDefaultSettings(module);
    }

    /**
     * Initializes the module with Myrslok recommended settings:
     * <pre>
     *  - production src: src/main/java
     *  - test src: src/test/java
     *  - build src: src/build/java (Myrslok build files)
     *  - target dir: target (all module output in this dir)
     *  - production classes: target/main/java
     *  - test classes: target/test/java
     *  - build classes: target/build/java
     * </pre>
     * @param module
     */
    private void initDefaultSettings(@NotNull final String module) {
        srcDirs.add(new File(moduleRoot, "src/main/java"));
        testDirs.add(new File(moduleRoot, "src/test/java"));
        buildDir = new File(moduleRoot, "src/build/java");
        targetDir = new File(moduleRoot, "target");
        targetProdClassesDir = new File(targetDir, "myrslok/production");
        targetTestClassesDir = new File(targetDir, "myrslok/test");
        targetBuildClassesDir = new File(targetDir, "myrslok/build");
    }

}
